import request from '@/utils/request'

export const getRoleListAPI = () => request('/park/sys/role')
/**
     * 获取tree权限列表
     * @returns
     */
export function getTreeListAPI() {
  return request({
    url: '/park/sys/permision/all/tree'
  })
}

export const getRoleDetailAPI = (id) => request(`/park/sys/role/${id}`)

export const getRoleUserAPI = (id) => request(`/park/sys/roleUser/${id}`)

export function createRoleUserAPI(data) {
  return request({
    url: `/park/sys/role`,
    method: 'POST',
    data
  })
}

export function updateRoleAPI(data) {
  return request({
    url: `/park/sys/role`,
    method: 'PUT',
    data
  })
}
